package cn.jdy.plugins.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import cn.jdy.common.bo.BaseEntry;
import cn.jdy.framework.db.hibernate.Validator;
import cn.jdy.platform.entity.ConfValue;

/**
 * 智库实体
 */
@Entity
public class Doc extends BaseEntry {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)//根据数据库自动适配 mysql默认自增
	private Long id;              //主键
	private String summary;       //摘要
	@Column(length = 8)
	private String paymentType;   //付费类型 0 免费  1  付费
	@Validator(value = Validator.AuType.ISGREATERTHAN, compare = 0)
	private int score;            //积分
	@Validator
	private int readTimes;        //阅读次数
	@Validator
	private int goodTimes;        //点蛅次数
	@Validator
	private int downTimes;        //下载此次数
	@Column(length = 20)
	private String author;        //作者
	@Column(columnDefinition = "longtext")
	private String context;       //内容
	@Column(length = 50)
	private String keyword;       //关键词
	@Column(length = 100)
	private String originAddress; //来源
	@Column(length = 100)
	private String imgUrl;        //封面图片地址
	@Column(length = 100)
	private String fileUrl;       //附件地址
	@Validator
	@Column(length = 50)
	private String fileType;      //附件类型
	@Validator
	@Column(length = 100)
	private String postil;        //审核批语
	@Validator
	@Column(length = 50)
	private String userName;      //发布人
	@Column(length = 50, nullable = false)
	private String title;         //标题
	@Column(length = 1, nullable = false)
	private String status;        //状态： 0 待审核 1审核通过  2 审核不通过   3 禁用
	@Column(length = 20, updatable = false)
	private String userId;        //发布人ID
	@Column(length = 1, updatable = false)
	private String userType;      //发布人类型  f 前台   b 后台

	@Column(nullable = false, updatable = false)
	private Long columnId;
	@ManyToOne
	@JoinColumn(name = "columnId", insertable = false, updatable = false)
	private ConfValue cv;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public String getContext() {
		return context;
	}

	public void setContext(String context) {
		this.context = context;
	}

	public String getSummary() {
		return summary;
	}

	public void setSummary(String summary) {
		this.summary = summary;
	}

	public String getKeyword() {
		return keyword;
	}

	public void setKeyword(String keyword) {
		this.keyword = keyword;
	}

	public String getOriginAddress() {
		return originAddress;
	}

	public void setOriginAddress(String originAddress) {
		this.originAddress = originAddress;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getImgUrl() {
		return imgUrl;
	}

	public void setImgUrl(String imgUrl) {
		this.imgUrl = imgUrl;
	}

	public String getFileUrl() {
		return fileUrl;
	}

	public void setFileUrl(String fileUrl) {
		this.fileUrl = fileUrl;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getPostil() {
		return postil;
	}

	public void setPostil(String postil) {
		this.postil = postil;
	}

	public String getUserType() {
		return userType;
	}

	public void setUserType(String userType) {
		this.userType = userType;
	}

	public int getScore() {
		return score;
	}

	public void setScore(int score) {
		this.score = score;
	}

	public int getReadTimes() {
		return readTimes;
	}

	public void setReadTimes(int readTimes) {
		this.readTimes = readTimes;
	}

	public int getGoodTimes() {
		return goodTimes;
	}

	public void setGoodTimes(int goodTimes) {
		this.goodTimes = goodTimes;
	}

	public int getDownTimes() {
		return downTimes;
	}

	public void setDownTimes(int downTimes) {
		this.downTimes = downTimes;
	}

	public Long getColumnId() {
		return columnId;
	}

	public void setColumnId(Long columnId) {
		this.columnId = columnId;
	}

	public ConfValue getCv() {
		return cv;
	}

	public void setCv(ConfValue cv) {
		this.cv = cv;
	}

	public String getPaymentType() {
		return paymentType;
	}

	public void setPaymentType(String paymentType) {
		this.paymentType = paymentType;
	}

	public String getFileType() {
		return fileType;
	}

	public void setFileType(String fileType) {
		this.fileType = fileType;
	}
	
	
}
